<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Js数据类型</title>
</head>
<body>
    <script>
        //Js数据类型 = 原始类型 + 引用类型
        //原始类型：number string boolan null undefined
        var a = 1;
        var b = 9.9;
        var c = '你';
        var d = '你好';
        var e = true;
        var f = false;
        console.log(a,typeof a,b,typeof b,c,typeof c,d,typeof d,e,typeof e,f,typeof f);
        //声明了变量但未赋值，会得到undefined，未定义型
        var g;
        console.log(g,typeof g);

        let obj={
            name:'张三',
            age:18,
            sex:'男'
        }
        console.log(obj,typeof obj);
        console.log(obj.name,obj.age,obj.sex);
        obj.age=19;
        console.log(obj);
        obj.like='do love';
        console.log(obj);
        console.log(obj.like);

        let arr=['张三','李四','王五',1,6.6,false];
        console.log(arr,typeof arr);
        console.log(arr[0],arr[1],arr[2],arr[3],arr[4],arr[5]);
        console.log(arr[97]);
    </script>
</body>
</html>